--spTipoMaquinariaDel 3
create procedure spTipoMaquinariaDel
  @Codigo int
with encryption
as
	declare @intError int
	begin transaction
	
	Delete TipoMaquinaria
		where 	
			Codigo = @Codigo 
			
      set @intError = @@Error
      if (@intError <> 0) goto onError
  
	commit transaction
	return @intError

onError:
  if @@TranCount > 0 rollback transaction
  return @intError
go
